package com.itcast.spring6.aop.xml;

import com.itcast.spring6.aop.annotation.HelloWorldService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zhangtian105
 * @date 2023/5/11
 * @apiNote
 */
@Slf4j
public class XmlApplicationContextTest {
    public static void main(String[] args) {
        // 创建容器
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring-aop-context.xml") ;

        // 启动应用上下文
        context.refresh();

        HelloWorldService helloWorldService = context.getBean("helloWorldService", HelloWorldService.class) ;
        // helloWorldService.helloWorld("水梦星光🌟") ;
        helloWorldService.testThis("see see !!! ") ;

        // 关闭spring应用上下文
        context.close();
    }
}
